<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>授予角色</title>
<link rel="shortcut icon" type="image/ico" href="${basePath}/favicon.ico?v=1"/>
<link rel="stylesheet" type="text/css" href="${basePath}/css/style_2_common.css?BPm" />
<link href="${basePath}/css/style-1.css?id=103" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="${basePath}/css/default_user_com.css" media="all">
<script type="text/javascript" src="${basePath}/js/jquery-1.8.3.min.js"></script>
<link rel="stylesheet" type="text/css" href="${basePath}/js/layer/skin/layer.css" />
<script type="text/javascript" src="${basePath}/js/layer/layer.m.js"></script>
</head>
<body id="nv_member" class="pg_CURMODULE">
<#assign menu_index="menu_103">
	<div id="wp" class="wp">
		<#include "/include/header.html"/>
		<div class="contentmanage">
			<div class="developer">
				<div class="tableContent">
                    <#include "/include/left.html"/>
                        <#include "/include/wxtop.html"/>
                    <div class="content">
						<div class="cLine">
							<div class="pageNavigator right">
								<form action="${basePath}/admin/user/grant" method="post" onsubmit="return checkForm();">
									<input name="roleid" type="hidden" <#if ur?exists>value="${ur.roleId}"</#if> />
									<input name="uid" type="hidden" value="${uid}" />
									<input class="btnGreen" type="submit" value="授权"/>
								</form>
							</div>
							<div class="pageNavigator left">
								<form action="${basePath}/admin/role/index" method="post">
									<input class="px" name="roleName" placeholder="输入角色名称查询" value="${roleName}" />
									<input class="btnGreen" type="submit" value="查询"/>
								</form>
							</div>
						</div>
						<div class="msgWrap">
							<table class="ListProduct Shallow_border_color" border="0" cellSpacing="0" cellPadding="0" width="100%">
								<thead>
									<tr>
										<th></th>
										<th>编号</th>
										<th>角色名称</th>
										<th>角色说明</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<#if page?exists>
									<#list page.recordList as bean>
									<tr>
										<td align="center"><input type="radio" name="id" value="${bean.id}" <#if ur.roleId=bean.id>checked</#if> /></td>
										<td valign="middle" align="center">${page.pernum*(page.currentPage-1)+bean_index+1}</td>
										<td align="center"><span>${bean.roleName?default('')}</span></td>
										<td>${bean.roleDecs?default('')}</td>
										<td class="norightborder left">
											<a href="javascript:void(0);" onclick="selectThis(this)">选中</a>
										</td>
									</tr>
									</#list>
									</#if>
								</tbody>
							</table>
						</div>
						
						<#assign formUrl="${basePath}/admin/role/index?">
						<#include "/include/pagination.html">
					</div>
					<div class="clr"></div>
				</div>
			</div>
		</div>
		<!--底部-->
	</div>
	<!--ad start-->
	<!--ad end-->
	</div>
	</div>
	</div>
	<#include "/include/footer.html"/>
	<script type="text/javascript">
		function checkForm(){
			var $roleid=$(":hidden[name='roleid']");
			if($roleid.val()==""){
				var $radio=$(":radio:checked");
				if($radio.length>0){
					$roleid.val($radio.val());
					return true;
				}else{
					layer.alert("请选择角色！");
					return false;
				}
			}
			return true;
		}
		function selectThis(that){
			$(":hidden[name='roleid']").val($(that).closest("td").siblings().eq(0).find(":radio").attr("checked","checked").val());
		}
	</script>
</body>
</html>